<?php

use think\facade\Route;
use app\admin\middleware\LoginMiddleware;
use app\admin\middleware\AuthMiddleware;
use app\admin\middleware\OperationLog;

Route::group('setting', function (){

    Route::group('dbMysql', function () {
        //表列表
        Route::get('lists', 'setting.DbMysql/lists');
        //表详情
        Route::get('detail', 'setting.DbMysql/detail');
        //优化表
        Route::post('optimize', 'setting.DbMysql/optimize');
        //清理表
        Route::post('fragment', 'setting.DbMysql/fragment');
    });

    Route::group('dbRedis', function () {
        //redis信息
        Route::get('info', 'setting.DbRedis/info');
        //编辑缓存
        Route::post('edit', 'setting.DbRedis/edit');
        //缓存详情
        Route::get('detail', 'setting.DbRedis/detail');
        //删除缓存
        Route::delete('delete', 'setting.DbRedis/delete');
    });

    Route::group('area', function () {
        //区域列表
        Route::get('lists', 'setting.Area/lists');
        //添加区域
        Route::post('add', 'setting.Area/add');
        //编辑区域
        Route::post('edit', 'setting.Area/edit');
        //区域详情
        Route::get('detail', 'setting.Area/detail');
        //删除区域
        Route::delete('delete', 'setting.Area/delete');
    });

    Route::group('storage', function () {
        //存储配置列表
        Route::get('lists', 'setting.Storage/lists');
        //编辑存储配置
        Route::post('edit', 'setting.Storage/edit');
        //存储配置详情
        Route::get('detail', 'setting.Storage/detail');
        //切换存储驱动
        Route::post('change', 'setting.Storage/change');
    });

    Route::group('sms', function () {
        //短信配置列表
        Route::get('lists', 'setting.Sms/lists');
        //编辑短信配置
        Route::post('edit', 'setting.Sms/edit');
        //短信配置详情
        Route::get('detail', 'setting.Sms/detail');
        //切换短信渠道
        Route::post('change', 'setting.Sms/change');
    });

    Route::group('notice', function () {
        //消息管理列表
        Route::get('lists', 'setting.Notice/lists');
        //编辑消息管理
        Route::post('edit', 'setting.Notice/edit');
        //消息管理详情
        Route::get('detail', 'setting.Notice/detail');
        //切换消息渠道状态
        Route::post('change', 'setting.Notice/change');
    });

    Route::group('noticeLog', function () {
        //消息日志列表
        Route::get('lists', 'setting.NoticeLog/lists');
        //消息日志详情
        Route::get('detail', 'setting.NoticeLog/detail');
    });

    Route::group('pay', function () {
        //支付配置列表
        Route::get('lists', 'setting.Pay/lists');
        //编辑支付配置
        Route::post('edit', 'setting.Pay/edit');
        //支付配置详情
        Route::get('detail', 'setting.Pay/detail');
        //切换支付渠道状态
        Route::post('change', 'setting.Pay/change');
    });

    //操作日志
    Route::get('log/lists', 'setting.Log/lists');
    //操作日志详情
    Route::get('log/detail', 'setting.Log/detail');
    //队列日志
    Route::get('queue/lists', 'setting.queue/lists');
    //队列日志详情
    Route::get('queue/detail', 'setting.queue/detail');
    //导出日志
    Route::get('export/lists', 'setting.export/lists');
    //导出日志详情
    Route::get('export/detail', 'setting.export/detail');
    //导出文件下载
    Route::get('export/download', 'setting.export/download');
    //删除导出日志
    Route::delete('export/delete', 'setting.export/delete');
    //获取系统环境信息
    Route::get('sysInfo', 'setting.System/sysInfo');
    //获取系统消息列表
    Route::get('sysMessageList', 'setting.System/sysMessageList');
    //清除系统缓存
    Route::post('clearCache', 'setting.System/clearCache');
    //获取基础信息
    Route::get('getWebInfo', 'setting.WebSet/getWebInfo');
    //设置基础信息
    Route::post('setWebInfo', 'setting.WebSet/setWebInfo');
    //获取备案信息
    Route::get('getWebRecord', 'setting.WebSet/getWebRecord');
    //设置备案信息
    Route::post('setWebRecord', 'setting.WebSet/setWebRecord');
    //获取地图信息
    Route::get('getMapInfo', 'setting.WebSet/getMapInfo');
    //设置地图信息
    Route::post('setMapInfo', 'setting.WebSet/setMapInfo');
    //编辑协议
    Route::post('agreement/edit', 'setting.Agreement/edit');
    //协议详情
    Route::get('agreement/detail', 'setting.Agreement/detail');
    //获取邮件信息
    Route::get('getMailInfo', 'setting.WebSet/getMailInfo');
    //设置邮件信息
    Route::post('setMailInfo', 'setting.WebSet/setMailInfo');
    //获取上传信息
    Route::get('getUploadInfo', 'setting.WebSet/getUploadInfo');
    //设置上传信息
    Route::post('setUploadInfo', 'setting.WebSet/setUploadInfo');

})->middleware([
    LoginMiddleware::class,
    AuthMiddleware::class,
    OperationLog::class
]);